package com.hex.ds.hdrs.center.dao;

import com.hex.bigdata.hbda.base.BaseDao;
import com.hex.ds.hdrs.center.po.MasterCenterInfo;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public class MasterCenterInfoDao extends BaseDao {

    /**
     * 抢占DB
     *
     * @param map
     */
    public boolean grabDb(Map map) {
        return this.update("com.hex.ds.hdrs.center.dao.MasterCenterInfoDao.grabDb", map) > 0;
    }

    /**
     * 查询
     * @return
     */
    public MasterCenterInfo qry() {
        return this.selectOne(MasterCenterInfo.class, "com.hex.ds.hdrs.center.dao.MasterCenterInfoDao.qry", null);
    }

    /**
     * 新增
     * @param map
     */
    public void add(Map map) {
        this.insert("com.hex.ds.hdrs.center.dao.MasterCenterInfoDao.insert", map);
    }

    /**
     * 更新
     * @param map
     */
    public void update(Map map) {
        this.update("com.hex.ds.hdrs.center.dao.MasterCenterInfoDao.update", map);
    }
}